#include <iostream>
#include <deque>
#include <algorithm>
using namespace std;

void dequePrint(const deque<int> d)
{
	for (deque<int>::const_iterator it = d.begin(); it != d.end(); it++)
	{
		cout << *it << " ";
	}
	cout << endl;
}

void myPrint01(int d)
{
	cout << d << " ";
}

int main4() 
{
	deque<int> d;
	d.push_back(20);
	d.push_back(10);
	d.push_back(30);
	d.push_back(200);
	d.push_back(100);
	d.push_back(300);
	dequePrint(d);

	sort(d.begin(), d.end());
	//dequePrint(d);

	for_each(d.begin(), d.end(), myPrint01);

	return 0;
}